

package exam;


public class Certificate extends StudentResult{
    private String certificate;
    
    /**
     * Constructor for Certificate class
     * super() to call up constructor in parent class
     */
    
    Certificate(){
        super();
        certificate = "No Certificate Awarded";
    }
    
    String certificateAwarded(int aScore){
        String aGrade = examGrade(aScore);
        
        switch(aGrade){
            case "Grade is A":
                this.certificate = "Certificate of Excellent";
                break;
            case "Grade is B": case "Grade is C":
                this.certificate = "Certificate of Achievement";
                break;
            default:
                this.certificate = "No certificate awarded";  
        }
        
        return this.certificate;
    }
    
}
